bitkeeper revision 1.1159.1.343 (41880bb7AJ8umt4zFmHNCc5REYAL8Q)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 2 Nov 2004 22:35:35 +0000 (22:35 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 2 Nov 2004 22:35:35 +0000 (22:35 +0000)
nasty merge

1  2 
.rootkeys
Makefile

diff --cc .rootkeys
index 7f41bc10c83accd6d6042ff58f6358e32228da53,0fdbcffd4a47b58a65981aae75e675c875340566..372473c5a5d265b57146d0a92d6be1347beb2737
+++ b/.rootkeys
@@@ -5,9 -5,14 +5,14 @@@
  4177dbbfqsi01p2zgZa0geUOgScONw COPYING
  3eb788d6Kleck_Cut0ouGneviGzliQ Makefile
  3f5ef5a24IaQasQE2tyMxrfxskMmvw README
+ 41880852AtdVfSsfKGtrLdajX1vEXQ buildconfigs/Rules.mk
+ 41880852oSxvHJSmnzI6hlpFvHuQqQ buildconfigs/linux-2.4-xen0
+ 41880852YWbPAO-cofTsGkFW1x7tGw buildconfigs/linux-2.4-xenU
+ 41880852Cwk_14PhDA9XZToJ5B2iMQ buildconfigs/linux-2.6-xen0
+ 41880852siMCKilMpoBLtpP_bhYC2Q buildconfigs/linux-2.6-xenU
  3f9e7d53iC47UnlfORp9iC1vai6kWw docs/Makefile
 +4187c1c7IWmBinGdI19kL4MuZ6RLbQ docs/check_pkgs
  3f9e7d60PWZJeVh5xdnk0nLUdxlqEA docs/figs/xenlogo.eps
 -418273f3YZUyGIrNbERVAPFeOd9gww docs/figs/xenserver.obj
  4022a73cgxX1ryj1HgS-IwwB6NUi2A docs/misc/XenDebugger-HOWTO
  412f4bd9sm5mCQ8BkrgKcAKZGadq7Q docs/misc/blkif-drivers-explained.txt
  40d6ccbfKKBq8jE0ula4eHEzBiQuDA docs/misc/xen_config.html
diff --cc Makefile
index aac39d5498a5159948a92dbbecb447866a916f5c,840ea59632906e0b67551b47b08887ef09c73983..38510b4cfaaf4ad6bcd0144b8236a5d27df587f6
+++ b/Makefile
@@@ -9,164 -8,42 +9,46 @@@ SOURCEFORGE_MIRROR := http://heanet.dl.
  #http://voxel.dl.sourceforge.net/sourceforge/
  #http://easynews.dl.sourceforge.net/sourceforge
  
- .PHONY: docs delete-symlinks clean all install dist
+ #KERNELS = linux-2.6-xen0 linux-2.6-xenU linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
+ KERNELS = linux-2.6-xen0 linux-2.6-xenU
  
- # a not partcularly useful but safe default target
- all:
+ export INSTALL_DIR SOURCEFORGE_MIRROR
+ .PHONY: all dist install kernels kdelete mkpatches world docs clean mrproper
 -all: 
++all: dist
++
++# build and install everything into local dist directory
++dist:
        $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
        $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
 -
 -# install xen and tools into the install directory
 -dist: all
 -
+       $(MAKE) kernels
 +      sh ./docs/check_pkgs && \
 +              $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C docs install
  
  # install everything into the standard system directories
- install: dist
+ # NB: install explicitly does not check that everything is up to date!
+ install: 
        $(MAKE) -C xen install
        $(MAKE) -C tools install
+       $(shell cp -a install/boot/* /boot/)
+       $(shell cp -a install/lib/modules/* /lib/modules/)
 +      sh ./docs/check_pkgs && $(MAKE) -C docs install
 +      $(shell cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/)
 +      $(shell cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/)
  
- # install xen and tools into the install directory
- dist: all
-       $(MAKE) linux-xenU
-       $(MAKE) linux-xen0
-       install -m0644 ./COPYING $(DIST_DIR)
-       install -m0644 ./README $(DIST_DIR)
-       install -m0755 ./install.sh $(DIST_DIR)
- LINUX_RELEASE    ?= 2.6
- LINUX_VER        ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
-                     sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
- LINUX26_VER      ?= $(shell ( /bin/ls -ld linux-2.6.*-xen-sparse ) 2>/dev/null | \
-                     sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
- LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
- LINUX_SRC_PATH   ?= .:..
- LINUX_SRC        ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
-                     $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
- # search for a pristine kernel tar ball, or try downloading one
- pristine-linux-src: 
- ifeq ($(LINUX_SRC),)
-       @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
-       @wget http://www.kernel.org/pub/linux/kernel/v$(LINUX_RELEASE)/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
- LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2 
- endif
- patches/ebtables.diff:
-       mkdir -p patches
-       #wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
-            -O- | gunzip -c > $@
-       wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@
- LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
- # make a linux-xen build tree from a pristine kernel plus sparse tree
- ifeq ($(LINUX_RELEASE),2.4)
- mk-linux-trees: patches/ebtables.diff pristine-linux-src 
-       $(RM) -rf $(LINUX_TREES)
-       echo $(LINUX_SRC) | grep -q bz2 && \
-           tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
-       mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
-       ( cd linux-$(LINUX_VER)-xen-sparse ; \
-           ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
-       cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
-       ( cd linux-$(LINUX_VER)-xen0 ; \
-           patch -p1 -F3 < ../patches/ebtables.diff ; \
-           sed -e 's/^EXTRAVERSION.*/&-xen0/' Makefile >Mk.tmp ; \
-           rm -f Makefile ; mv Mk.tmp Makefile )
-       ( cd linux-$(LINUX_VER)-xenU ; \
-           sed -e 's/^EXTRAVERSION.*/&-xenU/' Makefile >Mk.tmp ; \
-           rm -f Makefile ; mv Mk.tmp Makefile )
- else
- mk-linux-trees: pristine-linux-src 
-       $(RM) -rf $(LINUX_TREES)
-       echo $(LINUX_SRC) | grep -q bz2 && \
-           tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
-       mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
-       ( cd linux-$(LINUX_VER)-xen-sparse ; \
-           ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
-       cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
-       ( cd linux-$(LINUX_VER)-xen0 ; \
-           sed -e 's/^EXTRAVERSION.*/&-xen0/' Makefile >Mk.tmp ; \
-           rm -f Makefile ; mv Mk.tmp Makefile )
-       ( cd linux-$(LINUX_VER)-xenU ; \
-           sed -e 's/^EXTRAVERSION.*/&-xenU/' Makefile >Mk.tmp ; \
-           rm -f Makefile ; mv Mk.tmp Makefile )
- endif
- # configure the specified linux tree
- CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
- ifeq ($(LINUX_RELEASE),2.4)
- config-xen%:
-       $(MAKE) -C $(CDIR) ARCH=xen mrproper
-       cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)$(subst config,,$@) \
-           $(CDIR)/.config || \
-           $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
-       $(MAKE) -C $(CDIR) ARCH=xen oldconfig
-       $(MAKE) -C $(CDIR) ARCH=xen dep
- else
- config-xen%:
-       $(MAKE) -C $(CDIR) ARCH=xen mrproper
-       @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
-         && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
-               $(CDIR)/.config || \
-       $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
- endif
- # build the specified linux tree
- BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
- linux-xen%:   
-       $(MAKE) -C $(BDIR) ARCH=xen modules
-       $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
-           modules_install
-       $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
- NETBSD_RELEASE   ?= 2.0
- NETBSD_VER       ?= $(shell ( /bin/ls -ld netbsd-$(NETBSD_RELEASE)*-xen-sparse ) 2>/dev/null | \
-                     sed -e 's!^.*netbsd-\(.\+\)-xen-sparse!\1!' )
- NETBSD_CVSSNAP   ?= 20040906
- NETBSD_SRC_PATH  ?= .:..
- NETBSD_SRC       ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
-                     $(wildcard $(dir)/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.*z*)))
- NETBSD_TOOLS_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
-                     $(wildcard $(dir)/netbsd-$(NETBSD_VER)-tools.tar.*z*)))
- NETBSD_TREES := netbsd-$(NETBSD_VER)-xenU
- pristine-netbsd-src: 
- ifeq ($(NETBSD_SRC),)
-       @echo "Cannot find netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.gz in path $(NETBSD_SRC_PATH)"
-       @wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2 -O./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
- NETBSD_SRC := ./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2 
- endif
- pristine-netbsd-tools-src: 
- ifeq ($(NETBSD_TOOLS_SRC),)
-       @echo "Cannot find netbsd-$(NETBSD_VER)-tools.tar.gz in path $(NETBSD_SRC_PATH)"
-       @wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-tools.tar.bz2 -O./netbsd-$(NETBSD_VER)-tools.tar.bz2
- NETBSD_TOOLS_SRC := ./netbsd-$(NETBSD_VER)-tools.tar.bz2 
- endif
- netbsd-tools: pristine-netbsd-tools-src
-       @[ -d netbsd-$(NETBSD_RELEASE)-tools ] || { \
-               echo extract $(NETBSD_TOOLS_SRC); \
-               tar -jxf $(NETBSD_TOOLS_SRC); }
- mk-netbsd-trees: netbsd-tools pristine-netbsd-src 
-       $(RM) -rf $(NETBSD_TREES)
-       echo $(NETBSD_SRC) | grep -q bz2 && \
-           tar -jxf $(NETBSD_SRC) || tar -zxf $(NETBSD_SRC)
-       mv netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP) \
-           netbsd-$(NETBSD_VER)-xenU
-       ( cd netbsd-$(NETBSD_VER)-xen-sparse ; \
-           ./mkbuildtree ../netbsd-$(NETBSD_VER)-xenU )
- # build the specified netbsd tree
- NBDIR = $(subst netbsd-,netbsd-$(NETBSD_VER)-,$@)
- netbsd-xen%:  
-       $(MAKE) -C $(NBDIR) config
-       $(MAKE) -C $(NBDIR) netbsd
-       $(MAKE) -C $(NBDIR) INSTALL_PATH=$(INSTALL_DIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-$(subst netbsd-,,$@) install
+ # Build all the various kernels
+ kernels:
+       for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i build ; done
+ # Delete the kernel build trees
+ kdelete:
+       for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i kdelete ; done
+ # Make patches from kernel sparse trees
+ mkpatches:
+       $(MAKE) -f buildconfigs/Rules.mk mkpatches
  
  # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
  # and place them in the install directory. 'make install' should then
@@@ -204,10 -62,13 +67,12 @@@ clean
        $(MAKE) -C tools clean
        $(MAKE) -C docs clean
  
- # clean, but blow away linux build tree plus src tar ball
+ # clean, but blow away kernel build tree plus tar balls
  mrproper: clean
-       rm -rf dist patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
+       rm -rf install/* patches *.tar.bz2 
+       for i in `ls buildconfigs | grep -v Rules.mk` ; do $(MAKE) -f buildconfigs/$$i kdelete || true ; done
+       $(MAKE) -f buildconfigs/Rules.mk mrproper
  
 -# handy target to install twisted (use rpm or apt-get in preference)
  install-twisted:
        wget http://www.twistedmatrix.com/products/get-current.epy
        tar -zxf Twisted-*.tar.gz